
import { lazy } from "react";
// 引入路由类型
import { RouterItem, RouterList } from "../utills/type";

// 定义二级路由，包含具体的页面路径和元素，以及标题
export const homeRouters: RouterItem[] = [
    {
        path: '/home/index',
        element: lazy(() => import('../Views/Index/index')),
        title: "首页"
    },
    {
        path: '/home/project',
        element: lazy(() => import('../Views/Poject/index')),
        title: "项目"
    },
   {
        path: '/home/geter',
        element: lazy(() => import('../Views/Geter/index')),
        title: "插画"
    },
    {
        path: '/home/stration',
        element: lazy(() => import('../Views/Stration/index')),
        title: "广告"
    },
    {
        path: '/home/color',
        element: lazy(() => import('../Views/Color/index')),
        title: "颜色"
    },
    {
        path: '/home/chat',
        element: lazy(() => import('../Views/chat/index')),
        title: "聊天室"
    },
    {
        path: '/home/ai',
        element: lazy(() => import('../Views/Ai/index')),
        title: "常见问题"
    },
    {
        path: '/home/user',
        element: lazy(() => import('../Views/User/index')),
        title: "个人中心"
    },
     {
        path: '/home/OnlineDesign',
        element: lazy(() => import('../Views/OnlineDesign/index')),
        title: "设计"
    },
    {
        path: '/home/cutout',
        element: lazy(() => import('../Views/Cutout/cutout')),
        title: "抠图"
    },
     {
        path: '/home/three',
        element: lazy(() => import('../Views/Three/index')),
        title: "第三周"
    }

]




// 定义工作台的二级路由，包含具体的页面路径和元素，以及标题
export const stagingRouters: RouterItem[] = [
    {
        id:1,
        path:'/staging/home',
        element: lazy(() => import('../Views/Staginghome/staginghome')),
        title: "首页"
    },
    {
        id:2,
        path:'/staging/material',
        element: lazy(() => import('../Views/SourceMaterial/sourcematerial')),
        title: "素材"
    },
    {
        path:'/staging/daydetial',
        element:lazy(() => import('../Views/Daydetail/daydetail')),
    },
]


// 定义订单发票的二级路由
export const orderRouters:RouterItem[]=[
    {
        id:1,
        path:'/orderof/guocoin',
        element: lazy(() => import('../Views/Guocoin/index')),
        title: "果币充值"
    },
    {
        id:2,
        path:'/orderof/invoice',
        element: lazy(() => import('../Views/Invoice/index')),
        title: "订单管理"
    },
        {
        id:3,
        path:'/orderof/modules',
        element: lazy(() => import('../Views/Moduler/index')),
        title: "模版管理"
    }
]


// 定义一级路由配置，使用history模式
// 包含根路径重定向、home路由、Login路由和默认错误页面
const routerList: RouterList = {
    mode: 'history',
    routes: [
        {
            path: '/',
            to: '/home/index',
        },
        {
            path: '/home',
            element: lazy(() => import('../Views/Home/index')),
            children: homeRouters,// 嵌套子路由
        },
        {
            path: '/login',
            element: lazy(() => import('../Views/Login/index')),
        },
        {
            path: '/staging',
            element: lazy(() => import('../Views/Staging/staging')),
            children: stagingRouters,
        },
         {
            path: '/orderof',
            element: lazy(() => import('../Views/Orderof/index')),
            children:orderRouters,
        },
        {
            path: '*',
            element: lazy(() => import('../Views/Error/index')),
        }
    ]
}
export default routerList// 导出路由配置供其他模块使用
